Skip to content

feat: add nvim-tree and neotree integration #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ThomasK33
Copy link
Member

@ThomasK33 ThomasK33 commented Jun 7, 2025

Fixes #14

Summary

  • Adds comprehensive integration with nvim-tree and neo-tree file explorers, enabling Claude to navigate and interact with project file structures
  • Implements @-mention functionality for files and directories, allowing Claude to quickly reference and work with specific paths in the project

Features

  • File Explorer Integration: Seamless support for both nvim-tree and neo-tree plugins
  • :ClaudeCodeTreeAdd @-mention Support: Add @filename or @directory/ reference to files and folders using the new command
  • Visual Commands: New visual mode commands for enhanced file interaction
  • Directory Navigation: Claude can now understand and work with project directory structures

Test Coverage

  • Added comprehensive unit tests for @-mention functionality (at_mention_spec.lua)
  • Added directory-specific @-mention tests (directory_at_mention_spec.lua)
  • Updated build system and dependencies for improved development experience

Change-Id: I22a048a068ce66e6f6ee8c4177a2a78178ab6616

@ThomasK33 ThomasK33 marked this pull request as ready for review June 8, 2025 08:04
@ThomasK33 ThomasK33 force-pushed the thomask33/nvim-tree-integration branch from 993fc6d to 9952bd4 Compare June 8, 2025 08:07
ThomasK33 added 3 commits June 8, 2025 10:13
Change-Id: I22a048a068ce66e6f6ee8c4177a2a78178ab6616
Signed-off-by: Thomas Kosiewski <[email protected]>
Enable diff tool to handle file creation by displaying empty buffer comparison for non-existent files instead of erroring. Includes automatic parent directory creation and updated test expectations.

Change-Id: I0032117b04309c63b605e21390083abb9ec741b2
Signed-off-by: Thomas Kosiewski <[email protected]>
- Replace fallback to single-file selection with line-by-line node mapping
- Support visual line selection (V), character selection (v), and block selection (Ctrl-V)
- Add comprehensive test suite for nvim-tree visual selection scenarios
- Include deduplication and root-level file filtering
- Maintain compatibility with existing nvim-tree marks functionality

Fixes issue where multi-selection in nvim-tree only sent cursor file instead of all selected files.

Change-Id: Ida7b3154f0b6749903ff0e847752d5c263a09de7
Signed-off-by: Thomas Kosiewski <[email protected]>
@ThomasK33 ThomasK33 force-pushed the thomask33/nvim-tree-integration branch from 9952bd4 to 1ef01d3 Compare June 8, 2025 08:13
@tomaszferens
Copy link

Shouldn't we have just a regular ClaudeCodeAdd <file-path / dir-path> command? and then the users can use it to integrate with whatever picker / file-tree explorer they are using?

- Extract broadcast_at_mention() for single file broadcasts
- Extract add_paths_to_claude() for batch operations with optional delays
- Refactor all existing handlers to use centralized functions
- Add ClaudeCodeAdd <file-path> command for direct file addition
- Remove verbose comments that describe "what" instead of "why"
- Add comprehensive documentation to README with examples
- Add 13 test cases covering command registration, validation, and functionality
- Maintain all existing functionality and test compatibility (164 tests passing)

Change-Id: I171dbc0bcc82d72c5c9a4f3d891a71fc3c814dbc
Signed-off-by: Thomas Kosiewski <[email protected]>
@ThomasK33
Copy link
Member Author

Shouldn't we have just a regular ClaudeCodeAdd <file-path / dir-path> command? and then the users can use it to integrate with whatever picker / file-tree explorer they are using?

Great point. I'll add both direct integrations and a ClaudeCodeAdd <filepath> [optional start line] [optional end line].

- Add optional start-line and end-line arguments to ClaudeCodeAdd command
- Convert 1-indexed user input to 0-indexed for Claude compatibility
- Add comprehensive validation for line numbers (positive, start <= end)
- Ignore line numbers for directories with debug logging
- Remove redundant vim.notify calls (logger handles notifications)
- Update README with line range syntax and examples
- Add extensive test coverage for all line range scenarios
- Clean up chatty comments that describe obvious operations

Change-Id: Ied866de821628c6f274faac3c82e527a0eaf46e1
Signed-off-by: Thomas Kosiewski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add nvim-tree integration to add file in explorer to mention file name in claude code
2 participants